home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 9
/
The PC-SIG Library on CD ROM - Ninth Edition.iso
/
201_300
/
DISK0214
/
DISK0214.ZIP
/
CFORM.BAS
< prev
next >
Wrap
BASIC Source File
|
1983-03-10
|
19KB
|
641 lines
4 DEFINT A-W,Y-Z
5 DIM F$(17),FLDN$(17,30),FTY(17,30),FL(17,30),IOPT(30)
13 DIM L(17),NREC(17)
16 DIM KY(17,30),KEYLIST(17,30)
18 DIM FORM$(10)
19 DIM EN(80),CE(80,10),TE(80,10),L$(80,10),EFN(80,10)
35 DIM K$(80)
70 CH = 29
74 PRINT FRE(0)
80 GOSUB 52000
100 GOSUB 50000
200 GOTO 1000
500 REM ******* CLS
510 CLS
520 RETURN
1000 GOSUB 5920
1220 GOSUB 500
1240 PRINT "******* FORM DESCRIPTIONS INITIAL MENU *********"
1245 PRINT ""
1250 PRINT " 0 - EXIT "
1255 PRINT ""
1260 PRINT " 1 - ENTER A NEW FORM DESCRIPTION"
1265 PRINT ""
1280 PRINT " 2 - READ A READ A FORM DESCRIPTION"
1300 PRINT " WITH - CORECTIONS"
1320 PRINT " - PRINT ON PAPER "
1325 PRINT ""
1340 PRINT "****** ENTER THE NUMBER THEN PRESS RETURN ******"
1360 PRINT ""
1380 GOSUB 60000
1382 IF DT# <0 OR DT#> 2 GOTO 1380
1390 T = DT#
1395 IF T = 0 GOTO 51000
1400 ON T GOTO 1420,1500
1420 REM ********** REM NEW CUSTOM INPUT **********
1440 GOSUB 1900
1460 GOSUB 3560
1480 GOTO 1220
1500 REM ********** READ A OUTPUT DESCRIPTION *********
1520 PRINT "******** WHAT FORM DO YOU WANT TO SEE ********"
1540 GOSUB 6060
1560 PRINT "******** WHAT FORM DO YOU WANT TO SEE ********"
1565 GOSUB 60000
1567 IF DT# <1 OR DT# >MAXFORM GOTO 1565
1570 T = DT#
1580 N$ = FORM$(T)
1600 GOSUB 3960
1620 GOSUB 4340
1640 PRINT " PRESS ANY KEY TO CONTINUE "
1660 IF INKEY$ = "" GOTO 1660
1680 PRINT "****************** OPTIONS : ****************"
1700 PRINT " 0 - RETURN TO INITIAL MENU"
1720 PRINT " 1 - MAKE CORRECTIONS"
1740 PRINT " 2 - PRINT ON PAPER "
1760 PRINT "***** ENTER THE NUMBER THEN PRESS RETURN *****"
1780 GOSUB 60000
1782 IF DT# <0 OR DT#> 2 GOTO 1780
1790 T1 = DT#
1800 IF T1 = 0 GOTO 1220
1820 IF T1 = 1 GOTO 5300
1840 GOSUB 4820
1860 GOTO 1220
1880 GOTO 1220
1900 GOSUB 500
1920 GOSUB 6160
1940 PRINT "********************** CUSTOM OUTPUT ROUTINE *******************"
1960 PRINT ""
1980 PRINT "********* HOW MANY LINES DO YOU WANT ON YOUR OUTPUT FORM ******"
2000 GOSUB 60050
2002 IF DT# <1 OR DT#> 100 GOTO 2000
2010 LN = DT#
2020 GOSUB 500
2040 PRINT "YOU WANT ";LN;" LINES ON YOUR OUTPUT FORM "
2060 PRINT "*************** IS THAT CORRECT **************"
2080 PRINT " 1 - CORRECT "
2100 PRINT " 2 - NOT CORRECT"
2110 PRINT "***** ENTER THE NUMBER THEN PRESS RETURN *****"
2120 GOSUB 60000
2122 IF DT# <1 OR DT#> 2 GOTO 2120
2130 T = DT#
2140 IF T = 2 GOTO 1900
2160 GOSUB 500
2180 PRINT "********** WHICH FILE DO YOU WANT TO USE IN THIS FROM **********"
2200 PRINT ""
2220 FOR T = 1 TO MAXF
2240 PRINT T;"-";F$(T)
2260 NEXT T
2280 PRINT ""
2300 PRINT "************* ENTER THE NUMBER THEN PRESS RETURN ***************"
2305 GOSUB 60000
2307 IF DT# <1 OR DT#> MAXF GOTO 2305
2310 MF = DT#
2320 GOSUB 500
2340 N$ = FORM$(TH)
2360 REM ****** BEGIN LINE LOOP ******
2380 FOR L = 1 TO LN
2400 GOSUB 2460
2420 NEXT L
2440 RETURN
2460 GOSUB 500
2480 PRINT "********** LINE NUMBER";L;"**********"
2500 PRINT ""
2520 PRINT "HOW MANY ENTRIES ON THIS LINE ?"
2540 GOSUB 60000
2542 IF DT# <1 OR DT#> 10 GOTO 2540
2550 EN(L) = DT#
2660 REM ******* BEGIN ENTRY LOOP ********
2680 FOR E = 1 TO EN(L)
2700 GOSUB 2760
2720 NEXT E
2740 RETURN
2760 GOSUB 500
2780 PRINT "*********** LINE ";L;" ENTRY ";E;" ***********"
2800 PRINT ""
2820 PRINT "WHAT COLUMN TO YOU WANT THIS ENTRY TO START AT ?
2840 GOSUB 60050
2842 IF DT# <1 OR DT#> 250 GOTO 2840
2850 CE(L,E) = DT#
2860 PRINT "********** WHAT TYPE IS THE ENTRY ************"
2880 PRINT " 1 - STRING CONSTANT"
2900 PRINT " 2 - GET FROM MAIN FILE"
2920 PRINT " 3 - STRING CORESPONDING TO A KEY FROM A FILE "
2940 PRINT " 4 - BLANK"
2950 PRINT "***** ENTER THE NUMBER THEN PRESS RETURN *****"
2960 GOSUB 60000
2962 IF DT# <1 OR DT#> 4 GOTO 2960
2965 IF DT# = 4 THEN DT# = 5
2970 TE(L,E) = DT#
2980 ON TE(L,E) GOTO 3000,3080,3300,3520,3520
3000 REM ***** STRING CONSTANT *****
3020 PRINT "****** ENTER THE CONSTANT THEN PRESS RETURN ******"
3030 MAX = 70
3040 GOSUB 62030
3050 L$(L,E) = A$
3060 GOTO 3520
3080 REM ***** GET FROM MAIN FILE *****
3100 GOSUB 500
3120 PRINT "**************** GET FROM MAIN FILE ****************"
3140 PRINT " FILE NAME ";F$(MF)
3160 PRINT " RECORD NUMBER AUTOMATICALLY INCREMENTS FOR EACH FORM "
3180 PRINT "*** WHAT FIELD DO YOU WANT TO GET THE ENTRY FROM ***"
3200 FOR T = 1 TO NREC(MF)
3220 PRINT T;"-";FLDN$(MF,T)
3240 NEXT T
3260 PRINT "***** ENTER THE FIELD NUMBER THEN PRESS RETURN *****"
3265 GOSUB 60000
3267 IF DT# <1 OR DT#> NREC(MF) GOTO 3265
3270 EFN(L,E) = DT#
3280 GOTO 3520
3300 REM ******** PRINT KEY CORRESPONDING TO A KEY
3320 PRINT "****** PRINT KEY CORESPONDING TO FILE ENTRY ********"
3340 PRINT " FILE NAME ";F$(MF)
3360 PRINT " RECORD NUMBER AUTOMATICALLY INCREMENTS FOR EACH FORM "
3380 PRINT "**** WHAT FIELD DO YOU WANT TO BASE THE KEY ON *****"
3400 FOR T = 1 TO NREC(MF)
3420 PRINT T;"-";FLDN$(MF,T)
3440 NEXT T
3460 PRINT "***** ENTER THE FIELD NUMBER THEN PRESS RETURN *****"
3465 GOSUB 60000
3467 IF DT# <1 OR DT#> NREC(MF) GOTO 3465
3468 IF KY(MF,DT#) <> 2 GOTO 3465
3470 EFN(L,E) = DT#
3480 GOTO 3520
3520 RETURN
3540 RETURN
3560 REM ********** WRITE DATA ON FILE ***********
3580 PRINT " FILE NAME ";N$
3600 OPEN "O",#1,N$
3620 WRITE #1,LN,MF,SFO
3640 IF SFO = 1 THEN WRITE #1,TMF,TSF,SF
3660 FOR T1 = 1 TO LN
3680 WRITE #1,EN(T1)
3700 FOR T2 = 1 TO EN(T1)
3720 WRITE #1,CE(T1,T2),TE(T1,T2)
3740 ON TE(T1,T2) GOTO 3760,3800,3840,3880,3880
3760 WRITE #1,L$(T1,T2)
3780 GOTO 3880
3800 WRITE #1,EFN(T1,T2)
3820 GOTO 3880
3840 WRITE #1,EFN(T1,T2)
3860 GOTO 3880
3880 NEXT T2
3900 NEXT T1
3920 CLOSE
3940 RETURN
3960 REM ********** READ DATA ON FILE ***********
3980 OPEN "I",#1,N$
4000 INPUT #1,LN,MF,SFO
4020 IF SFO = 1 THEN INPUT #1,TMF,TSF,SF
4040 FOR T1 = 1 TO LN
4060 INPUT #1,EN(T1)
4080 FOR T2 = 1 TO EN(T1)
4100 INPUT #1,CE(T1,T2),TE(T1,T2)
4120 ON TE(T1,T2) GOTO 4140,4180,4220,4260,4260
4140 INPUT #1,L$(T1,T2)
4160 GOTO 4260
4180 INPUT #1,EFN(T1,T2)
4200 GOTO 4260
4220 INPUT #1,EFN(T1,T2)
4240 GOTO 4260
4260 NEXT T2
4280 NEXT T1
4300 CLOSE
4320 RETURN
4340 REM ********** PRINT DATA ON PAPER *********
4360 PRINT "CUSTOM OUTPUT FILE NAME ";N$
4380 PRINT "NUMBER OF LINES ";LN
4400 PRINT "MAIN FILE ";F$(MF)
4420 IF SFO = 2 THEN GOTO 4440
4440 FOR T1 = 1 TO LN
4460 PRINT "***** LINE NUMBER ";T1;"NUMBER OF ENTRIES";EN(T1)
4480 FOR T2 = 1 TO EN(T1)
4500 PRINT "ENTRY # ";T2;"COLUMN NUMBER ";CE(T1,T2)
4520 ON TE(T1,T2) GOTO 4540,4580,4640,4700,4740
4540 PRINT " STRING CONSTANT : ";L$(T1,T2)
4560 GOTO 4760
4580 T3 = EFN(T1,T2)
4600 PRINT " GET FROM MAIN FILE - FIELD = ";FLDN$(MF,T3)
4620 GOTO 4760
4640 T3 = EFN(T1,T2)
4660 PRINT " PRINT VALUE CORESPONDING TO A KEY ";FLDN$(MF,T3)
4680 GOTO 4760
4700 PRINT " GET FROM SECONDARY FILE - FORMAT SAME AS LAST LINE"
4720 GOTO 4760
4740 PRINT " LINE BLANK "
4760 NEXT T2
4780 NEXT T1
4800 RETURN
4820 REM ********** PRINT DATA ON PAPER *********
4840 LPRINT "CUSTOM OUTPUT FILE NAME ";N$
4860 LPRINT "NUMBER OF LINES ";LN
4880 LPRINT "MAIN FILE ";F$(MF)
4920 FOR T1 = 1 TO LN
4940 LPRINT "LINE NUMBER ";T1;"NUMBER OF ENTRIES";EN(T1)
4960 FOR T2 = 1 TO EN(T1)
4980 LPRINT "ENTRY # ";T2;"COLUMN NUMBER ";CE(T1,T2)
5000 ON TE(T1,T2) GOTO 5020,5060,5120,5180,5220
5020 LPRINT " STRING CONSTANT : ";L$(T1,T2)
5040 GOTO 5240
5060 T3 = EFN(T1,T2)
5080 LPRINT " GET FROM MAIN FILE - FIELD = ";FLDN$(MF,T3)
5100 GOTO 5240
5120 T3 = EFN(T1,T2)
5140 LPRINT " VALUE CORESPONDING TO KEY = ";FLDN$(MF,T3)
5160 GOTO 5240
5180 LPRINT " GET FROM SECONDARY FILE - FORMAT SAME AS LAST LINE"
5200 GOTO 5240
5220 LPRINT " LINE BLANK "
5240 NEXT T2
5260 NEXT T1
5280 RETURN
5300 REM ********** CORRECT RECORD ROUTINE ***********
5320 GOSUB 500
5340 PRINT "****************** OPTIONS : ******************"
5360 PRINT " 1 - RETURN TO INITIAL MENU"
5380 PRINT " 2 - CHANGE A SINGLE ENTRY"
5400 PRINT " 3 - CHANGE AN ENTIRE LINE"
5420 PRINT "***** ENTER THE NUMBER THEN PRESS RETURN *****"
5440 GOSUB 60000
5442 IF DT# <1 OR DT#> 3 GOTO 5440
5450 TC = DT#
5460 IF TC = 1 THEN GOSUB 3560
5480 IF TC = 1 GOTO 1220
5500 IF TC = 2 GOTO 5600
5520 PRINT "WHAT LINE DO YOU WANT TO CHANGE ?"
5540 GOSUB 60000
5550 L = DT#
5560 GOSUB 2460
5580 GOTO 5300
5600 REM ******* CHANGE A SINGLE ENTRY *******
5620 PRINT "WHAT LINE IS THE ENTRY ON THAT YOU WANT TO CHANGE ?"
5640 GOSUB 60050
5642 IF DT# <1 OR DT#> 100 GOTO 5640
5650 L = DT#
5660 PRINT "WHAT IS THE ENTRY NUMBER THAT YOU WANT TO CHANGE ? "
5680 GOSUB 60000
5682 IF DT# <1 OR DT#> 10 GOTO 5680
5690 E = DT#
5700 GOSUB 2760
5720 GOTO 5300
5740 REM ******* LIST OF FORM FILE ********
5760 OPEN "O",#1,"FORMLIST"
5780 WRITE #1,MAXFORM
5800 FOR T = 1 TO MAXFORM
5820 WRITE #1,FORM$(T)
5840 NEXT T
5860 CLOSE #1
5880 RETURN
5900 REM ********* INPUT LIST OF FORMS FROM DISK *********
5920 OPEN "I",#1,"FORMLIST"
5940 INPUT #1,MAXFORM
5960 FOR T = 1 TO MAXFORM
5980 INPUT #1,FORM$(T)
6000 NEXT T
6020 CLOSE #1
6040 RETURN
6060 REM ******* PRINT FORM LIST *******
6080 FOR T = 1 TO MAXFORM
6100 PRINT T;"-";FORM$(T)
6120 NEXT T
6140 RETURN
6160 GOSUB 500
6180 PRINT "************** WHAT FORM DO YOU WANT ***************"
6200 GOSUB 6060
6220 PRINT ""
6240 PRINT " YOU MAY REDEFINE ANY OF THE ABOVE FORMS "
6260 PRINT " OR"
6280 PRINT " YOU MAY DEFINE A NEW FORM "
6300 PRINT ""
6320 PRINT "********* ENTER A NUMBER FROM 1 TO ";MAXFORM + 1;"*********"
6340 GOSUB 60000
6342 IF DT# <1 OR DT#> (MAXFORM + 1) GOTO 6340
6350 T = DT#
6360 TH = T
6380 IF T > MAXFORM + 1 THEN GOTO 6160
6400 GOSUB 6500
6420 IF T = MAXFORM + 1 THEN MAXFORM = T
6440 GOSUB 500
6460 PRINT "FORM NAME : ";N$
6480 RETURN
6500 PRINT "******* WHAT IS THE NAME OF YOUR FORM *******"
6510 PRINT "First Character must be a letter."
6515 PRINT "No spaces between characters."
6520 PRINT ""
6540 PRINT "***** ENTER THE NAME THEN PRESS RETURN ******"
6550 MAX = 8
6560 GOSUB 62030
6562 GOSUB 8000
6564 IF TEST = 4 GOTO 6560
6570 FORM$(T) = A$
6580 N$ = FORM$(T)
6600 GOSUB 5740
6620 RETURN
8000 REM ***** FILE NAME ACCEPLABLE TEST ************
8010 TEST = 1
8100 FOR Q = 1 TO LEN(A$)
8110 K$(Q) = MID$(A$,Q,1)
8120 C = ASC(K$(Q))
8130 IF C < 48 OR C > 122 THEN TEST = 4
8140 IF Q = 1 AND ( C < 65 OR C > 122 ) THEN TEST = 4
8150 NEXT Q
8190 RETURN
23780 REM ************* READ SUBROUTINE *************
23800 OPEN "I",#1,"FFILE"
23820 INPUT #1,MAXF
23840 FOR A = 1 TO MAXF
23860 INPUT #1,A,F$(A),NREC(A),L(A)
23880 FOR N = 1 TO NREC(A)
23900 INPUT #1,FLDN$(A,N),FTY(A,N),FL(A,N)
23920 IF FTY(A,N) = 2 THEN INPUT #1,KY(A,N),KEYLIST(A,N)
23940 NEXT N
23960 NEXT A
23980 CLOSE #1
24000 RETURN
50000 REM ********** INTRO
50010 GOSUB 500
50100 PRINT " F O R M D E S C R I P T I O N P R O G R A M 3.0 "
50105 PRINT ""
50110 PRINT " Copyright 1984 by Potomac Pacific Engineering Inc."
50120 PRINT ""
50130 PRINT "This program is licensed FREE to all users with some restrictions "
50165 PRINT " See the manual for more information on the license."
50167 PRINT ""
50920 GOSUB 23780
50950 PRINT "****************** PRESS ANY KEY TO CONTINUE *******************";
50960 IF INKEY$ = "" GOTO 50960
50970 RETURN
51000 REM ***** EXIT TO SYSTEM
51100 GOSUB 500
51110 CLOSE
51120 PRINT " -BYE, Have a nice day"
51130 END
52000 REM ***** INTRO 1
52010 GOSUB 500
52100 PRINT " Put the DATA DISK in the default disk drive "
52110 PRINT ""
52120 PRINT " ***** THEN PRESS ANY KEY TO CONTINUE *****"
52130 PRINT ""
52140 PRINT " The CUSTOM programs only use the PROGRAM DATA DISK"
52150 PRINT "Keep it in the default disk drive at all times during this program."
52200 IF INKEY$ = "" GOTO 52200
52210 RETURN
60000 REM ******* INTEGER LESS THEN 100 CHECK ********
60010 MAX = 2
60020 ACT$ = "1234567890=<>^"
60030 IF NE = 0 THEN ACT$ = "1234567890"
60040 PRINT ">__<";
60045 GOTO 60240
60050 REM
60060 REM ******* INTEGER *******
60070 MAX = 8
60080 ACT$ = "1234567890-+,=<>^"
60090 IF NE = 0 THEN ACT$ = "1234567890-+,"
60100 PRINT ">________<";
60110 GOTO 60240
60120 REM ******* SINGLE PRECISION *******
60130 MAX = 10
60140 ACT$ = "1234567890-+,.%$=<>^"
60150 IF NE = 0 THEN ACT$ = "1234567890+-,.%$"
60160 PRINT ">__________<";
60170 GOTO 60240
60180 REM ******* DOUBLE PRECISION *******
60190 MAX = 20
60200 ACT$ = "1234567890-+,.%$=<>^"
60210 IF NE = 0 THEN ACT$ = "1234567890+-,.%$"
60220 PRINT ">____________________<";
60230 GOTO 60240
60240 REM ********** NUMBER CHECK **********
60250 A$ = ""
60260 K$(20) = " "
60270 KTMAX = 0
60280 FOR T9 = 1 TO MAX
60290 K$(T9) = " "
60300 NEXT T9
60310 DIG$ = "1234567890."
60320 DOTFLG = 0
60330 T2 = MAX + 1
60340 FOR T6 = 1 TO T2
60350 PRINT CHR$(CH);
60360 NEXT T6
60370 IF INKEY$ = "" GOTO 60380 ELSE GOTO 60370
60380 KT = 0
60390 REM *********** CHECK ALFANUMERIC INPUT FOR LENGTH ***********
60400 KT = KT + 1
60410 REM
60420 W$ = INKEY$
60430 IF W$ = "" GOTO 60420
60440 C = ASC(W$)
60450 IF C = 0 THEN GOSUB 61900
60460 IF C = 13 GOTO 60580
60470 IF C = 17 OR C = 8 GOTO 61150
60480 IF C = 19 GOTO 60670
60490 IF C = 4 GOTO 60720
60500 IF C = 6 GOTO 60780
60510 IF C = 1 GOTO 60960
60520 IF KT > MAX GOTO 60410
60530 IF INSTR(ACT$,W$) = 0 GOTO 61230
60540 K$(KT) = W$
60550 PRINT K$(KT);
60560 IF KT > KTMAX THEN KTMAX = KT
60570 GOTO 60400
60580 REM ********** RETURN **********
60590 FOR T9 = 1 TO KTMAX
60600 A$ = A$ + K$(T9)
60610 NEXT T9
60620 IF KTMAX = 0 THEN PRINT "1"
60630 IF KTMAX = 0 THEN DT# = 1
60640 IF KTMAX = 0 THEN RETURN
60650 PRINT ""
60660 GOTO 61260
60670 REM ********* MOVE CURSE BACK ********
60680 IF KT = 1 GOTO 60410
60690 KT = KT - 1
60700 PRINT CHR$(CH);
60710 GOTO 60410
60720 REM ********* MOVE CURSER FORWARD *********
60730 IF KT >= MAX GOTO 60410
60740 IF KT > (KTMAX + 1) GOTO 60410
60750 PRINT K$(KT);
60760 KT = KT + 1
60770 GOTO 60410
60780 REM ********** INSERT ***********
60790 IF KT > KTMAX GOTO 60410
60800 X9 = MAX
60810 WHILE X9 > KT
60820 X9 = X9 - 1
60830 K$(X9 + 1) = K$(X9)
60840 WEND
60850 K$(KT) = " "
60860 KTMAX = KTMAX + 1
60870 IF KTMAX > MAX THEN KTMAX = MAX
60880 FOR T9 = KT TO KTMAX
60890 PRINT K$(T9);
60900 NEXT T9
60910 T6 = (KTMAX - KT) + 1
60920 FOR T7 = 1 TO T6
60930 PRINT CHR$(CH);
60940 NEXT T7
60950 GOTO 60410
60960 REM ********** DELETE ***********
60970 IF KT > KTMAX GOTO 60410
60980 IF KTMAX = 1 GOTO 60410
60990 K$(MAX + 1) = ""
61000 X9 = KT
61010 WHILE X9 <= MAX
61020 K$(X9) = K$(X9 + 1)
61030 X9 = X9 + 1
61040 WEND
61050 KTMAX = KTMAX - 1
61060 FOR T9 = KT TO KTMAX
61070 PRINT K$(T9);
61080 NEXT T9
61090 PRINT "_";
61100 T7 = (KTMAX - KT) + 2
61110 FOR T8 = 1 TO T7
61120 PRINT CHR$(CH);
61130 NEXT T8
61140 GOTO 60410
61150 REM ********* BACKSPACE ********
61160 IF KT = 1 GOTO 60410
61170 KT = KT - 1
61180 PRINT CHR$(CH);
61190 K$(KT) = " "
61200 PRINT "_";
61210 PRINT CHR$(CH);
61220 GOTO 60410
61230 REM ******* INPUT NOT ACCEPTABLE ********
61240 PRINT CHR$(7);
61250 GOTO 60420
61260 REM ********* CLEAR STRINGS ********
61270 MAX = LEN(A$)
61280 D2$ = ""
61290 D1$ = ""
61300 DFLG = 0
61310 FOR Q93 = 1 TO MAX
61320 R$ = MID$(A$,Q93,1)
61330 IF INSTR(DIG$,R$) = 0 GOTO 61400
61340 IF R$ = "." OR DFLG = 1 GOTO 61380
61350 IF DFLG = 1 GOTO 61380
61360 D2$ = D2$ + R$
61370 GOTO 61400
61380 D1$ = D1$ + R$
61390 DFLG = 1
61400 NEXT Q93
61410 DA# = VAL(D2$)
61420 D1# = VAL(D1$)
61430 DT# = DA# + D1#
61440 IF K$(1) = "-" THEN DT# = -DT#
61450 RETURN
61900 REM ****** CHECK FOR ASC0
61910 S4$ = INKEY$
61920 C2 = ASC(S4$)
61930 IF C2 = 83 THEN C = 1
61940 IF C2 = 82 THEN C = 6
61950 IF C2 = 75 THEN C = 19
61960 IF C2 = 77 THEN C = 4
61970 RETURN
62000 REM ********** ALPHANUMERIC CHECK **************
62010 MAX = FL(A,Q)
62020 GOTO 62040
62030 REM ******** MAX SET IN PROGRAM ********
62040 A$ = ""
62050 PRINT ">";
62060 FOR N9 = 1 TO MAX
62070 K$(N9) = ""
62080 PRINT "_";
62090 NEXT N9
62100 PRINT "<";
62110 T2 = MAX + 1
62120 FOR T4 = 1 TO T2
62130 PRINT CHR$(CH);
62140 NEXT T4
62150 KT = 0
62160 KTMAX = 1
62170 REM *********** CHECK ALFANUMERIC INPUT FOR LENGTH ***********
62180 KT = KT + 1
62190 PRINT TAB(KT+1)"";
62200 K$ = INKEY$
62210 IF K$ = "" GOTO 62200
62220 C = ASC(K$)
62230 IF C = 0 THEN GOSUB 61900
62240 IF C = 13 GOTO 62350
62250 IF C = 17 OR C = 8 GOTO 62920
62260 IF C = 19 GOTO 62450
62270 IF C = 4 GOTO 62500
62280 IF C = 6 GOTO 62560
62290 IF C = 1 GOTO 62730
62300 IF KT > MAX GOTO 62190
62310 K$(KT) = K$
62320 PRINT K$(KT);
62330 IF KT > KTMAX THEN KTMAX = KT
62340 GOTO 62180
62350 REM ********** RETURN **********
62360 FOR T9 = 1 TO MAX
62370 A$ = A$ + K$(T9)
62420 NEXT T9
62430 PRINT ""
62440 RETURN
62450 REM ********* MOVE CURSE BACK ********
62460 IF KT = 1 GOTO 62190
62470 KT = KT - 1
62480 PRINT CHR$(CH);
62490 GOTO 62190
62500 REM ********* MOVE CURSER FORWARD *********
62510 IF KT >= MAX GOTO 62190
62520 IF KT > KTMAX GOTO 62190
62530 PRINT K$(KT);
62540 KT = KT + 1
62550 GOTO 62190
62560 REM ********** INSERT ***********
62570 X9 = MAX
62580 WHILE X9 > KT
62590 X9 = X9 - 1
62600 K$(X9 + 1) = K$(X9)
62610 WEND
62620 K$(KT) = " "
62630 KTMAX = KTMAX + 1
62640 IF KTMAX > MAX THEN KTMAX = MAX
62650 FOR T9 = KT TO KTMAX
62660 PRINT K$(T9);
62670 NEXT T9
62680 T6 = (KTMAX - KT) +1
62690 FOR T7 = 1 TO T6
62700 PRINT CHR$(CH);
62710 NEXT T7
62720 GOTO 62190
62730 REM ********** DELETE ***********
62740 IF KT > KTMAX GOTO 62200
62750 IF KTMAX = 1 GOTO 62190
62760 K$(MAX + 1) = ""
62770 X9 = KT
62780 WHILE X9 <= KTMAX
62790 K$(X9) = K$(X9 + 1)
62800 X9 = X9 + 1
62810 WEND
62820 KTMAX = KTMAX - 1
62830 FOR T9 = KT TO KTMAX
62840 PRINT K$(T9);
62850 NEXT T9
62860 PRINT "_";
62870 T7 = (KTMAX - KT) + 2
62880 FOR T6 = 1 TO T7
62890 PRINT CHR$(CH);
62900 NEXT T6
62910 GOTO 62190
62920 REM ********* BACKSPACE ********
62930 IF KT = 1 GOTO 62190
62940 K$(KT) = " "
62950 KT = KT - 1
62960 K$(KT) = " "
62970 PRINT CHR$(CH);
62980 PRINT "_";
62990 PRINT CHR$(CH);
63000 GOTO 62190
" "
62950 KT = KT - 1
62960 K$(KT) = " "
62970 PRINT CHR$(CH);
62980 PRINT "_";
62990 PRINT CHR$(CH);
63000 GO